<!-- Modified by Vu on 11/05/2013 -->

<div class="actions">
    	<ul>

                        		<li><?php echo $this->Html->link(__('Staff Users'), array('controller' => 'Users','action' => 'index')); ?></li>
                        		<li><?php echo $this->Html->link(__('Departments'), array('controller' => 'departments', 'action' => 'index')); ?> </li>
                        		<li><?php echo $this->Html->link(__('Contacts'), array('controller' => 'contacts', 'action' => 'index')); ?> </li>
                        		<li><?php echo $this->Html->link(__('Lists'), array('controller' => 'mail_lists', 'action' => 'index')); ?> </li>
                        		<li><?php echo $this->Html->link(__('Timesheets'), array('controller' => 'timesheets', 'action' => 'index')); ?> </li>
                        		<li><?php echo $this->Html->link(__('Notes'), array('controller' => 'notes', 'action' => 'index')); ?> </li>
                        	</ul>
    </div>

<div class="tbody">

<div class="contacts index">


	<h2><?php echo __('Contacts'); ?></h2>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<!--<th><?php echo $this->Paginator->sort('id'); ?></th>-->
			<th><?php echo $this->Paginator->sort('first_name'); ?></th>
			<th><?php echo $this->Paginator->sort('middle_name'); ?></th>
			<th><?php echo $this->Paginator->sort('last_name'); ?></th>
			<th><?php echo $this->Paginator->sort('position'); ?></th>
			<th><?php echo $this->Paginator->sort('email'); ?></th>
			<th><?php echo $this->Paginator->sort('mobile'); ?></th>
			<th><?php echo $this->Paginator->sort('home'); ?></th>
			<th><?php echo $this->Paginator->sort('office'); ?></th>
			<th><?php echo $this->Paginator->sort('address'); ?></th>
			<th><?php echo $this->Paginator->sort('notes'); ?></th>
			<th><?php echo $this->Paginator->sort('list'); ?></th>
			<th><?php echo $this->Paginator->sort('created_date'); ?></th>
			<th><?php echo $this->Paginator->sort('modified_date'); ?></th>
			<th><?php echo $this->Paginator->sort('department_of_contact'); ?></th>
			<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php foreach ($contacts as $contact): ?>
	<tr>
		<!--<td><?php echo h($contact['Contact']['id']); ?>&nbsp;</td>-->
		<td><?php echo h($contact['Contact']['first_name']); ?>&nbsp;</td>
		<td><?php echo h($contact['Contact']['middle_name']); ?>&nbsp;</td>
		<td><?php echo h($contact['Contact']['last_name']); ?>&nbsp;</td>
		<td><?php echo h($contact['Contact']['position']); ?>&nbsp;</td>
		<td><?php echo h($contact['Contact']['email']); ?>&nbsp;</td>
		<td><?php echo h($contact['Contact']['mobile']); ?>&nbsp;</td>
		<td><?php echo h($contact['Contact']['home']); ?>&nbsp;</td>
		<td><?php echo h($contact['Contact']['office']); ?>&nbsp;</td>
		<td><?php echo h($contact['Contact']['address']); ?>&nbsp;</td>
		<td><?php echo h($contact['Contact']['notes']); ?>&nbsp;</td>
		<td><?php echo h($contact['Contact']['list']); ?>&nbsp;</td>
		<td><?php echo h($contact['Contact']['created_date']); ?>&nbsp;</td>
		<td><?php echo h($contact['Contact']['modified_date']); ?>&nbsp;</td>
		<td><?php echo h($contact['Contact']['dept_of_cont']); ?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('View'), array('action' => 'view', $contact['Contact']['id'])); ?>
			<?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $contact['Contact']['id'])); ?>
			<?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $contact['Contact']['id']), null, __('Are you sure you want to delete '.$contact['Contact']['first_name']." ".$contact['Contact']['middle_name']." ".$contact['Contact']['last_name'].' ?')); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>

                    	<?php
                    		echo "<p>";
                    		$urlAdd = array('controller' => '/Contacts/','action' => 'add');
                            echo $this->Form->button('Add New Contact', array('onclick' => "location.href='".$this->Html->url($urlAdd)."'"));
                            echo "&nbsp;&nbsp;";
                            $urlImport = array('controller' => '/Contacts/','action' => 'upload');
                            echo $this->Form->button('Import new file', array('onclick' => "location.href='".$this->Html->url($urlImport)."'"));
                        ?>

            	<p>

    	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
	));
	?>
	<div class="paging">
	<?php
		echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	</div>
</div>

</div>